<#include "/common/layout.html">
<@header>
</@header>
<@body>
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      <small>CICD Management > Template Management</small>
    </h1>
  </section>
  <!-- Main content -->
  <section class="content">
    <!-- Your Page Content Here -->
    <div class="row">
      <div class="col-xs-12">
        <div class="box">
         <form action="/projects/template/list/1" method="post" class="form-inline">
          <div class="box-header">
            <@shiro.hasPermission name="addTemplate">
            <div class="input-group">
           	 <a class="btn btn-primary dialog" href="javascript:;" data-title="Create Template" data-url="/projects/template/add" data-width="800" data-height="650"><i class="fa fa-plus"></i> Create Template</a>
            </div>
            </@shiro.hasPermission>
            <div class="input-group">
               <input type="text" name="search" value="${search!}" class="form-control" placeholder="Search">
               <div class="input-group-btn">
                 <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                 <a href="/projects/template/list/1" class="btn btn-default"><i class="fa fa-refresh"></i></a>
               </div>
            </div>
            <div class="input-group pull-right">
                 <button type="button" class="btn btn-primary btn-flat" onclick="exportTo('Menu Data');"><i class="fa fa-file-excel-o"></i> Export</button>
            </div>
          </div><!-- /.box-header -->
          </form>
          <div class="box-body table-responsive no-padding">
            <table class="table table-hover">
              <tr>
               
                <th>Number</th>
                <th>Template Name</th>
                  <th>Template Description</th>
                <th>Create Date&Time</th>
                <th width="150px">Operate</th>
              </tr>
              <#list pageData.getRecords() as tpl>
              	  <tr>
	               
	                <td>${(tpl.id)!}</td>
	              
	                <td>${(tpl.templateName)!}</td>
	                   <td>${(tpl.desc)!}</td>
	                <td>${(tpl.created)!}</td>
	                <td>
	                	 <@shiro.hasPermission name="editMenu">
	                	   <a class="btn btn-primary btn-xs dialog" href="javascript:;" data-title="Edit Menu" data-url="/projects/template/edit/${(tpl.id)!}" data-width="800" data-height="650"  data-toggle="tooltip" title="Edit" data-placement="bottom">Edit</a>
	                	 </@shiro.hasPermission>
	                	<@shiro.hasPermission name="deleteMenu">
	                	<a class="btn btn-danger btn-xs" data-toggle="tooltip" title="Delete" data-placement="bottom"
	                	 data-tiggle="ajax"
	                	 data-submit-url="/projects/template/delete?id=${(tpl.id)!}"
	                	 data-confirm="Are you sure of deleting this record?">Delete</a>
	                	 </@shiro.hasPermission>
	                </td>
	              </tr>
              </#list>
            </table>
          </div><!-- /.box-body -->
          <div class="box-footer row">
          <div class="col-md-6">
         	  <#include "/common/paginateBar.html" />
	  		  <@paginate pageData=pageData actionUrl="/projects/template/list/" urlParas="?search=${search!}"  />
            </div>
            <div class="col-md-6 pull-left">
            <#include "/common/paginate.html" />
 			<@paginate currentPage=pageData.getCurrent() totalPage=pageData.getPages() actionUrl="/projects/template/list/" urlParas="?search=${search!}&pageSize=${pageSize!}"  />
            </div>
          </div>
        </div><!-- /.box -->
      </div>
    </div>
  </section><!-- /.content -->
</div><!-- /.content-wrapper -->
</@body>
<@footer>
</@footer>